package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(255)" json:"password"`
}
type Short struct {
	gorm.Model
	Title     string `gorm:"type:varchar(30)" json:"title"`
	Content   string `gorm:"type:varchar(30)" json:"content"`
	Img       string `gorm:"type:varchar(255)" json:"img"`
	UserID    int    `gorm:"type:int" json:"user_id"`
	User      User   `gorm:"foreignKey:UserID" json:"user"`
	LikeCount int    `gorm:"type:int" json:"like_count"`
}

type Like struct {
	gorm.Model
	UserID  int   `gorm:"type:int" json:"user_id"`
	User    User  `gorm:"foreignKey:UserID" json:"user"`
	ShortID int   `gorm:"type:int"  json:"short_id"`
	Short   Short `gorm:"foreignKey:ShortID" json:"short"`
}
